]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
windowManager: Support prepending workspace with horizontal layouts
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 19 Jun 2020 20:37:13 +0000 (22:37 +0200)
committerverdre <jonas@dressler.it>
Sat, 20 Jun 2020 08:15:44 +0000 (08:15 +0000)
Commit ce35d523a2 implemented that behavior for vertical workspace layouts,
there is no reason to not allow the same for horizontal layouts.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2916

js/ui/windowManager.js

index 1ea5daff706fc260469e526f2fad51f7e48b3b52..15e0ab624f7b41e52c31e7ae2959baa410cd535b 100644 (file)
@@ -2115,8 +2115,16 @@ var WindowManager = class {
             newWs = workspaceManager.get_workspace_by_index(workspaceManager.n_workspaces - 1);
         } else if (isNaN(target)) {
             // Prepend a new workspace dynamically
-            if (workspaceManager.get_active_workspace_index() == 0 &&
-                action == 'move' && target == 'up' && this._isWorkspacePrepended == false) {
+            let prependTarget;
+            if (vertical)
+                prependTarget = 'up';
+            else if (rtl)
+                prependTarget = 'right';
+            else
+                prependTarget = 'left';
+            if (workspaceManager.get_active_workspace_index() === 0 &&
+                action === 'move' && target === prependTarget &&
+                this._isWorkspacePrepended === false) {
                 this.insertWorkspace(0);
                 this._isWorkspacePrepended = true;
             }